function [ actors ] = buildLocalNetworkX( actor1, actor2, X, Y )

% Takes two actor indices (actor1 and actor2) and a matrix of relationships
% (X) between all network actors;
% Returns an index list of actors (actors) that influence the emergence of
% a relationship tie between actor1 and actor2 

[ ~, len ] = size( X ); 

actors = zeros( 0, 1 );

if ( Y( actor1, actor2 ) == 0 ) || ( Y( actor2, actor1 ) == 0 )
    return
end

for i = 1 : len
    if ( i == actor1 ) || ( i == actor2 )
        actors = [ actors; i ];
    elseif ( X( i, actor1 ) == 1 ) || ( X( i, actor2 ) == 1 )
        actors = [ actors; i ];
    end
end

